package com.keboom.show.controller;

import com.keboom.show.common.api.CommonResult;
import com.keboom.show.model.SpUser;
import com.keboom.show.service.UsersService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by keboom on 2020/9/6.
 */
@RestController
@RequestMapping("/api/users")
public class UsersController {
    @Autowired
    private UsersService usersService;

    @ApiOperation(value = "根据编号查询用户信息")
    @GetMapping(value = "/{id}")
    public CommonResult<SpUser> getItem(@PathVariable("id") Integer id){
        return CommonResult.success(usersService.findByUserId(id));
    }
}
